var mockData = require('../../../data/catedetail.js');

Page({
    data: {
        category: [
            {name:'烟机',id:'yanji'},
            {name:'热水器',id:'reshuiqi'},
            {name:'灶具',id:'zaoju'},
            {name:'消毒柜',id:'xiaodugui'}
        ],
        detail:[],
        curIndex: 0,
        isScroll: true,
        toView: 'guowei'
    },
    onReady(){
        
                this.setData({
                  detail: mockData.catelists
                })
         
        
    },
    switchTab(e){
      const self = this;
      this.setData({
        isScroll: true
      })
      setTimeout(function(){
        self.setData({
          toView: e.target.dataset.id,
          curIndex: e.target.dataset.index
        })
      },0)
      setTimeout(function () {
        self.setData({
          isScroll: false
        })
      },1)
        
    },
    onShareAppMessage() {return { title: '厨星宝电器', imageUrl: '/image/厨星宝电器.jpg', path: 'page/component/index' }}
    
})